package com.zdb.demo.design.pattern.creational.singleton;

import java.io.Serializable;

public class SerializableSingleton implements Serializable {

    private final static SerializableSingleton instance;

    static {
        instance = new SerializableSingleton();
    }

    private SerializableSingleton() {
        System.out.println("------------- \t 序列化");
    }

    public static SerializableSingleton getInstance() {
        return instance;
    }

    public Object readResolve() {
        return instance;
    }
}
